using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Neighborhood
{
    /// <summary>
    /// <para>Line Statistics</para>
    /// <para>Calculates a statistic on the attributes of lines in a circular neighborhood around each output cell.</para>
    /// <para>计算每个输出像元周围圆形邻域中线属性的统计数据。</para>
    /// </summary>    
    [DisplayName("Line Statistics")]
    public class LineStatistics : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public LineStatistics()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_polyline_features">
        /// <para>Input polyline features</para>
        /// <para>The input polyline features for which to calculate the statistics in a neighbourhood around each output cell.</para>
        /// <para>用于计算每个输出像元周围邻域中的统计数据的输入折线要素。</para>
        /// </param>
        /// <param name="_field">
        /// <para>Field</para>
        /// <para><xdoc>
        ///   <para>The field that the specified statistic will be calculated for. It can be any numeric field of the input features.</para>
        ///   <para>When the statistics type is set to Length, the Field parameter can be set to None.</para>
        ///   <para>It can be the Shape field if the input features contain z-values.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将为其计算指定统计数据的字段。它可以是输入要素的任意数值字段。</para>
        ///   <para>当统计信息类型设置为“长度”时，可以将“字段”参数设置为“无”。</para>
        ///   <para>如果输入要素包含 z 值，则它可以是形状字段。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para>The output line statistics raster.</para>
        /// <para>输出行统计栅格。</para>
        /// </param>
        public LineStatistics(object _in_polyline_features, object _field, object _out_raster)
        {
            this._in_polyline_features = _in_polyline_features;
            this._field = _field;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Line Statistics";

        public override string CallName => "sa.LineStatistics";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_polyline_features, _field, _out_raster, _cell_size, _search_radius, _statistics_type.GetGPValue()];

        /// <summary>
        /// <para>Input polyline features</para>
        /// <para>The input polyline features for which to calculate the statistics in a neighbourhood around each output cell.</para>
        /// <para>用于计算每个输出像元周围邻域中的统计数据的输入折线要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input polyline features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_polyline_features { get; set; }


        /// <summary>
        /// <para>Field</para>
        /// <para><xdoc>
        ///   <para>The field that the specified statistic will be calculated for. It can be any numeric field of the input features.</para>
        ///   <para>When the statistics type is set to Length, the Field parameter can be set to None.</para>
        ///   <para>It can be the Shape field if the input features contain z-values.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将为其计算指定统计数据的字段。它可以是输入要素的任意数值字段。</para>
        ///   <para>当统计信息类型设置为“长度”时，可以将“字段”参数设置为“无”。</para>
        ///   <para>如果输入要素包含 z 值，则它可以是形状字段。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _field { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para>The output line statistics raster.</para>
        /// <para>输出行统计栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Output cell size</para>
        /// <para><xdoc>
        ///   <para>The cell size of the output raster that will be created.</para>
        ///   <para>This parameter can be defined by a numeric value or obtained from an existing raster dataset. If the cell size hasn't been explicitly specified as the parameter value, the environment cell size value will be used if specified; otherwise, additional rules will be used to calculate it from the other inputs. See the usage section for more detail.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将创建的输出栅格的像元大小。</para>
        ///   <para>此参数可以由数值定义，也可以从现有栅格数据集中获取。如果尚未将像元大小显式指定为参数值，则在指定的情况下将使用环境像元大小值;否则，将使用其他规则从其他输入计算它。有关详细信息，请参阅用法部分。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output cell size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _cell_size { get; set; } = null;


        /// <summary>
        /// <para>Search radius</para>
        /// <para><xdoc>
        ///   <para>Search radius to calculate the desired statistic within, in map units.</para>
        ///   <para>The default radius is five times the output cell size.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>搜索半径以计算所需的统计数据，以地图单位表示。</para>
        ///   <para>默认半径是输出像元大小的五倍。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Search radius")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _search_radius { get; set; } = null;


        /// <summary>
        /// <para>Statistics type</para>
        /// <para><xdoc>
        ///   <para>Specifies the statistic type to be calculated.</para>
        ///   <para>Statistics are calculated on the value of the specified field for all lines within the neighborhood.</para>
        ///   <bulletList>
        ///     <bullet_item>Mean—Calculates the average field value in each neighborhood, weighted by the length.The form of the calculation is:Only the part of the length that falls within the neighborhood is used.
        ///     <bulletList>
        ///       <bullet_item>Mean = (sum of (length * field_value)) / (sum_of_length)  </bullet_item></bulletList>
        ///     </bullet_item><para/>
        ///     <bullet_item>Majority—Determines the value having the greatest length of line in the neighborhood.</bullet_item><para/>
        ///     <bullet_item>Maximum—Determines the largest value in the neighborhood.</bullet_item><para/>
        ///     <bullet_item>Median—Determines the median value, weighted by the length.Conceptually, all line segments in the neighborhood are sorted by value and placed end-to-end in a straight line. The value of the segment at the midpoint of the straight line is the median.</bullet_item><para/>
        ///     <bullet_item>Minimum—Calculates smallest value in each neighborhood.</bullet_item><para/>
        ///     <bullet_item>Minority—The value having the least length of line in the neighborhood.</bullet_item><para/>
        ///     <bullet_item>Range—The range of values (maximum–minimum).</bullet_item><para/>
        ///     <bullet_item>Variety—The number of unique values.</bullet_item><para/>
        ///     <bullet_item>Length—The total line length in the neighborhood. If the value of the field is other than 1, the lengths are multiplied by the item value before adding them together. This option can be used when the field parameter is set to None.</bullet_item><para/>
        ///   </bulletList>
        ///   <para>When the specified field is integer, the available statistic choices are Mean, Majority, Maximum, Median, Minimum, Minority, Range, and Variety. When the field is floating point, the only allowed statistics are Mean, Maximum, Minimum, and Range.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要计算的统计信息类型。</para>
        ///   <para>统计数据是根据邻域内所有线的指定字段的值计算的。</para>
        ///   <bulletList>
        /// <bullet_item>均值 - 计算每个邻域中的平均字段值，按长度加权。计算形式为：仅使用落在邻域内的长度部分。
        ///     <bulletList>
        /// <bullet_item>均值 = （长度 * field_value）的总和） / （sum_of_length） </bullet_item></bulletList>
        ///     </bullet_item><para/>
        ///     <bullet_item>多数 - 确定邻域中线长度最大的值。</bullet_item><para/>
        ///     <bullet_item>最大值 （Maximum） - 确定邻域中的最大值。</bullet_item><para/>
        ///     <bullet_item>中位数 （Median） - 确定按长度加权的中值。从概念上讲，邻域中的所有线段都按值排序，并首尾相接地放置在一条直线上。直线中点处的线段值为中位数。</bullet_item><para/>
        ///     <bullet_item>最小值 （Minimum） - 计算每个邻域中的最小值。</bullet_item><para/>
        ///     <bullet_item>少数 - 邻域中线长度最短的值。</bullet_item><para/>
        ///     <bullet_item>范围 - 值的范围（最大值/最小值）。</bullet_item><para/>
        ///     <bullet_item>多样性 - 唯一值的数量。</bullet_item><para/>
        ///     <bullet_item>长度 - 邻域中的总线长度。如果字段的值不是 1，则长度将乘以项目值，然后再将它们相加。当字段参数设置为 None 时，可以使用此选项。</bullet_item><para/>
        ///   </bulletList>
        ///   <para>当指定的字段为整数时，可用的统计数据选项为平均值、多数、最大值、中位数、最小值、少数、范围和多样性。当字段为浮点时，唯一允许的统计数据是 Mean、Maximum、Minimum 和 Range。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Statistics type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _statistics_type_value _statistics_type { get; set; } = _statistics_type_value._MEAN;

        public enum _statistics_type_value
        {
            /// <summary>
            /// <para>Mean</para>
            /// <para>Mean—Calculates the average field value in each neighborhood, weighted by the length.The form of the calculation is:Only the part of the length that falls within the neighborhood is used.</para>
            /// <para>均值 - 计算每个邻域中的平均字段值，按长度加权。计算形式为：仅使用落在邻域内的长度部分。</para>
            /// </summary>
            [Description("Mean")]
            [GPEnumValue("MEAN")]
            _MEAN,

            /// <summary>
            /// <para>Majority</para>
            /// <para>Majority—Determines the value having the greatest length of line in the neighborhood.</para>
            /// <para>多数 - 确定邻域中线长度最大的值。</para>
            /// </summary>
            [Description("Majority")]
            [GPEnumValue("MAJORITY")]
            _MAJORITY,

            /// <summary>
            /// <para>Maximum</para>
            /// <para>Maximum—Determines the largest value in the neighborhood.</para>
            /// <para>最大值 （Maximum） - 确定邻域中的最大值。</para>
            /// </summary>
            [Description("Maximum")]
            [GPEnumValue("MAXIMUM")]
            _MAXIMUM,

            /// <summary>
            /// <para>Median</para>
            /// <para>Median—Determines the median value, weighted by the length.Conceptually, all line segments in the neighborhood are sorted by value and placed end-to-end in a straight line. The value of the segment at the midpoint of the straight line is the median.</para>
            /// <para>中位数 （Median） - 确定按长度加权的中值。从概念上讲，邻域中的所有线段都按值排序，并首尾相接地放置在一条直线上。直线中点处的线段值为中位数。</para>
            /// </summary>
            [Description("Median")]
            [GPEnumValue("MEDIAN")]
            _MEDIAN,

            /// <summary>
            /// <para>Minimum</para>
            /// <para>Minimum—Calculates smallest value in each neighborhood.</para>
            /// <para>最小值 （Minimum） - 计算每个邻域中的最小值。</para>
            /// </summary>
            [Description("Minimum")]
            [GPEnumValue("MINIMUM")]
            _MINIMUM,

            /// <summary>
            /// <para>Minority</para>
            /// <para>Minority—The value having the least length of line in the neighborhood.</para>
            /// <para>少数 - 邻域中线长度最短的值。</para>
            /// </summary>
            [Description("Minority")]
            [GPEnumValue("MINORITY")]
            _MINORITY,

            /// <summary>
            /// <para>Range</para>
            /// <para>Range—The range of values (maximum–minimum).</para>
            /// <para>范围 - 值的范围（最大值/最小值）。</para>
            /// </summary>
            [Description("Range")]
            [GPEnumValue("RANGE")]
            _RANGE,

            /// <summary>
            /// <para>Variety</para>
            /// <para>Variety—The number of unique values.</para>
            /// <para>多样性 - 唯一值的数量。</para>
            /// </summary>
            [Description("Variety")]
            [GPEnumValue("VARIETY")]
            _VARIETY,

            /// <summary>
            /// <para>Length</para>
            /// <para>Length—The total line length in the neighborhood. If the value of the field is other than 1, the lengths are multiplied by the item value before adding them together. This option can be used when the field parameter is set to None.</para>
            /// <para>长度 - 邻域中的总线长度。如果字段的值不是 1，则长度将乘以项目值，然后再将它们相加。当字段参数设置为 None 时，可以使用此选项。</para>
            /// </summary>
            [Description("Length")]
            [GPEnumValue("LENGTH")]
            _LENGTH,

        }

        public LineStatistics SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}